package com.tms.drivermanagement.controller;


import com.tms.drivermanagement.service.FileUploadService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("pricture")
@CrossOrigin
public class FileUploadController {

    @Autowired
    private FileUploadService fileUploadService;

    @RequestMapping("fileUpload")
    public String fileUpload(MultipartFile file) throws Exception {
        String path= fileUploadService.fileUpload(file);
        return path;
    }
}
